'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView
Private components As System.ComponentModel.IContainer
'Required by the Windows Form Designer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents CheckBox1 As System.Windows.Forms.CheckBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TreeView1 = New System.Windows.Forms.TreeView()
Me.CheckBox1 = New System.Windows.Forms.CheckBox()
Me.SuspendLayout()
'
'TreeView1
'
Me.TreeView1.ImageIndex = -1
Me.TreeView1.LabelEdit = True
Me.TreeView1.Location = New System.Drawing.Point(24, 24)
Me.TreeView1.Name = "TreeView1"
Me.TreeView1.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("TreeNode", New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("First Child", New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("First Grandchild"), New System.Windows.Forms.TreeNode("Second Grandchild"), New System.Windows.Forms.TreeNode("Third Grandchild")}), New System.Windows.Forms.TreeNode("Second Child"), New System.Windows.Forms.TreeNode("Third Child")})})
Me.TreeView1.SelectedImageIndex = -1
Me.TreeView1.Size = New System.Drawing.Size(240, 256)
' Refuse to edit a node that has a children count on its Text.
Private Sub TreeView1_BeforeLabelEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.NodeLabelEditEventArgs) Handles TreeView1.BeforeLabelEdit
If System.Text.RegularExpressions.Regex.IsMatch(e.Node.Text, " \[.*\]$") Then
e.CancelEdit = True
MessageBox.Show("You can't edit while children count is displayed")